package com.itheima.sh.e_homework_05;
/*
定义功能，计算出数组中指定元素出现的次数。

	数组: int[] arr = {1,43,43,5,4,6,6,7,7,88,9,9,9,0,0,9};

	指定元素: int x = 9;

 */
public class HomeWork04 {
    public static void main(String[] args) {
        int[] arr = {1,43,43,5,4,6,6,7,7,88,9,9,9,0,0,9};
        int frequency = frequency(arr);
        System.out.println("frequency = " + frequency);
    }
    public static int  frequency(int[]arr){
                 int count=0;
        for (int i = 0; i < arr.length ; i++) {
            if (arr[i]==9){
                count++;
            }
        }
     return count;
    }
}
